package mq;

import java.util.Arrays;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * RPC请求消息
 * 
 * @author zyb
 *
 * 2018年2月21日 下午12:35:31
 */
public class Request {
	
	private static AtomicInteger index = new AtomicInteger();

	private long requestId;
	
	private Object[] args;
	
	public static Request create(Object[] args) {
		Request result = new Request();
		result.args = args;
		result.requestId = index.incrementAndGet();
		return result;
	}

	public long getRequestId() {
		return requestId;
	}

	public void setRequestId(long requestId) {
		this.requestId = requestId;
	}

	public Object[] getArgs() {
		return args;
	}

	public void setArgs(Object[] args) {
		this.args = args;
	}

	@Override
	public String toString() {
		return "Request [requestId=" + requestId + ", args=" + Arrays.toString(args) + "]";
	}
	
}
